package com.csx.framework.springboot.sample.aop.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p> what does this class do ? </p>
 * <p> How does it work ?</p>
 * <p> Why does it do this ?</p>
 *
 * @author cuisongxu
 * @date 2024/12/19 周四 11:40
 */

@RestController
@RequestMapping("/aop")
public class AopController {

    @GetMapping("/hello/{name}")
    public String hello(@PathVariable("name") String name) {
        if(name.equals("error")) {
            throw new RuntimeException("模拟异常");
        }
        return "hello " + name;
    }
}
